<?php
/**
 * View  LaFabbrica.org
 * 
 * @author     luigi.pastore (gigi@la-fabbrica.org)
 * @created    11-giu-2012
 * @package    LaFabbrica
 * @copyright  Copyright (c) 2011 Luigi Pastore
 */
?>
<script type="text/javascript">
    //<![CDATA[
    
    $(document).ready(function(){
	var pagination = $('#posts').pagination({
	    'targetUrl' : '/admin/ajax/list/posts',
	    'orderField' : 'post_published',
	    'orderDir' : 'asc'
	});
        


        $( "#searchField" ).keyup( function() {
            if($(this).val().length >= 3)
            {
                var pagination = $('#posts').pagination({
                    'targetUrl' : '/admin/search/posts/'+ $(this).val(),
                    'orderField' : 'post_published',
                    'orderDir' : 'asc',
                    'perPage' : 2
                });
            }
        });
    });     
    //]]>
</script>
<div class="info">
    ...
</div>
<div id="content">

<form>

    <ul>
	<li class="addnew">
	    <a class="button" href="nuovo">
		<img src="/images/admin/add-new.png" alt="Nuovo Post" />Nuovo Post
	    </a>
	</li>
<!--	<li>
	    <div id="loading">&nbsp;</div>
	</li>-->
	<li id="fo2li107" class="likert col4">
	    <div>
	    <table>
		<caption id="title107">
		    Tot: <strong><?php echo count($this->posts)?></strong> post.
                    <div class="searchBox">
                        <label class="search">Filter</label>
                        <input class="search" id="searchField" class="text" type="search" value="">
                    </div>
		</caption>
		<thead>
                    <tr>
                        <td class="pagination" colspan="5">
                            <a class="prev" href="javascript: void(0);">&nbsp;</a>
                            <span class="loader">Sto caricando...</span>
                            <a class="next" href="javascript: void(0);">&nbsp;</a>
                        </td>
                    </tr>
		    <tr>
			<th class="sortable default {ref: 'post_title'}">Titolo</th>
			<td class="sortable default {ref: 'post_category'}">Categoria</td>
			<td class="sortable default {ref: 'post_createdby'}">Autore</td>
			<td class="sortable asc {ref: 'post_published'}">Data</td>
			<td>&nbsp;</td>
		    </tr>
		</thead>
		<tbody id="posts">
<!--		    Questo contenuto verrÃƒÂ  rimpiazzato dalla paginazione-->
		</tbody>
		<tfoot>
                    <tr>
                        <td class="pagination" colspan="5">
                            <a class="prev" href="javascript: void(0);">&nbsp;</a>
                            <span class="loader">Sto caricando...</span>
                            <a class="next" href="javascript: void(0);">&nbsp;</a>
                        </td>
                    </tr>
		</tfoot>
	    </table>
		</div>
	</li>
    </ul>
</form>
</div>